<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>Bootstrap 模板</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!-- 设置字符编码集为国际编码 -->
		<meta charset="utf-8">
		<!-- IE兼容模式 通知 IE 采用其所支持的最新的模式 -->
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<link rel="stylesheet" href="animate.css" />
		<link rel="stylesheet" href="maxModal.css" />
   	</head>
	<body>
		<div id="showDialog">点我...</div>
		<script type="text/javascript" src="../js/jquery-1.11.3.min.js" ></script>
		<script type="text/javascript" src="maxModal.js" ></script>
		<script>
			
			
			var str = 'glyphicon glyphicon-home';
			
			console.log(str.replace('glyphicon ',''))
			
			$(function(){
				$("#showDialog").on("click",function(){
					top.diag = $.MaxDialog({
						type:'modal',
						content: '1231',
						width: "60%",
						height: "60%",
						data:{
							"msg":'children page'
						},
						//isFooter: false,
						url:"children.html",
						hideBefore: function(){
							// alert(top.diag.result);
							// alert(top.diag.get('result2'))
						},
						"buttons":[											//按钮组会被外部buttons参数全部替换（浅拷贝），
								{
									"text":"确定",								//按钮的文本内容
									"type":"Msuccess",					//按钮的类样式，可自定义,默认有Msuccess,Mcancel,Mclose三种样式
									"events":"click",						//按钮的默认事件触发类型，默认为click
									"callback":function(data){
										var doc = $(data).find("iframe").contents()[0];
										console.log($(data).find("iframe").contents()[0])
										console.log(doc)
										console.log('data', $(doc).find("#test").text())
										// console.log('data', doc.getElementById('test').value)
										alert($('#test').text())
										return false;
									}							//按钮触发事件的回调函数,如果想点击按钮后不关闭模态框，
																							//在回调函数中添加 return false 则不会关闭模态框
								},
								{
									"text":"取消",
									"type":"Mcancel",
									"events":"click",
									"callback":null
								}
							]
					})
				});
			});
			
		</script>
	</body>
</html>
